program Test;

{$APPTYPE CONSOLE}

uses
  GenAutomataTools;

var a:BAutGen;
    i,k,PerfectFit:integer;
    f:TextFile;
    
begin
  AssignFile(f,checklist);
  Reset(f);
  Read(f,i,k);
  PerfectFit:=i*10+k*5;
  CloseFile(f);
  randomize;

  CreateBAutGen(a);
  k:=0;
  repeat
    k:=k+1;
    BAutGenEvo(a);
    i:=BAutGenBest(a);
  until (k=250) or (a.fit[i]=PerfectFit);

  writeln('In ',k,' cycles was found a ',(a.fit[i]/PerfectFit*100):0:2,'%-fit automata:');
  BAutPrint(a.data[i]);
  readln;
end.
